flask sqlalchemy array column

78

from sqlalchemy.dialects.postgresql import ARRAY

class MyTable:
    __tablename__ = 'mytable'

    id = Column(Integer, primary_key=True)
    text_array = Column(ARRAY(Unicode))

    def __init__(self, text_array):
        self.text_array = text_array

Comments

Submit
0 Comments